package com.codemonkey.lq.extend.springmvc;

import java.util.Map;

public interface FileUploadInterceptor {

	/**
	 * 文件上传完毕之后的文件名称
	 */
	static final String CONTEXT_KEY_FILENAME_FINAL = "FILENAME_NEW";

	/**
	 * 文件上传时的文件名称
	 */
	static final String CONTEXT_KEY_FILENAME_ORIGIN = "FILENAME_ORIGIN";

	/**
	 * 客户端文件上传到的完整路径
	 */
	static final String CONTEXT_KEY_FILE_SAVED_FULL_PATH = "FILE_SAVED_FULL_PATH";

	/**
	 * Spring MVC 中的MultipartFile
	 */
	static final String CONTEXT_KEY_MULTIPARTFILE_OBJECT = "MultipartFile_KEY";

	boolean preUpload(Map<String, Object> context);

	String convertFileFinalName(Map<String, Object> context);

	/**
	 * @param context  <br>
	 * 	   包含如下键值对: <br>
	 * 	     <ul>
	 * 			<li></li>
	 * 			<li></li>
	 * 			<li></li>
	 * 		</ul>
	 */
	void doUpload(Map<String, Object> context);
}
